package com.sfac.javaSpringCloudWeb.config;

import com.sfac.javaSpringCloudWeb.interceptor.ViewMappingInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
//过滤器
@Configuration
public class WebMvcConfig implements WebMvcConfigurer{
    @Autowired
    private ViewMappingInterceptor viewMappingInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(viewMappingInterceptor).addPathPatterns("/**");
    }

}
